#include <msp430.h>
#include <stdint.h>


#include "common.h"



static uint8_t func_static(uint8_t val)
{
	STK_INIT(3);
	val = val +  P1IN;
	return val;
}




void f4(uint8_t x, indirect_fn_t findirect)
{
	STK_INIT(4);
	findirect(x);
}

void f9(uint8_t x, indirect_fn_t findirect)
{
	STK_INIT(9);
	
	findirect(P1IN);
}

void f11(uint8_t x)
{
	STK_INIT(11);
	func_static(P1IN);



}

#if TST_RECURSION

void fn_recursive1(uint8_t x)
{
	STK_INIT(5);
	if (x == 0) {
		P1IN;
	}

	fn_recursive1(x--);
}

void fn_recursive2(uint8_t x)
{
	STK_INIT(10);
	if (x == 0) {
		P1IN;
	}
	fn_recursive3(x--);
}

void fn_recursive3(uint8_t x)
{
	STK_INIT(12);
	if (x == 0) {
		P1IN;
	}
	fn_recursive2(x--);
}

#endif
